import request from '@/utils/request'

const PREFIX = '/rule'

/**
 * 查询菜单列表
 */
export function listMenu(params) {
  return request.get(`${PREFIX}/index`, { params })
}

export function listMenus(params) {
  return request.get(`${PREFIX}/index`, { params })
}

export function pageMenus(params) {
  return request.get(`${PREFIX}/index`, { params })
}

export function menuInfo(id) {
  return request.get(`${PREFIX}/info`, { params: { id } })
}

/**
 * 新增/修改菜单
 */
export function updateMenu(data) {
  return request.post(`${PREFIX}/edit`, data)
}

/**
 * 删除菜单
 */
export function removeMenu(id) {
  return request.post(`${PREFIX}/delete`, { id })
}
